package com.lsh.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ：LiuShihao
 * @date ：Created in 2021/3/18 1:56 下午
 * @desc ： Redisson配置
 */
@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient getRedissonClient(){
        System.out.println("RedissonConfig加载...");
        Config config = new Config();
        config.useSingleServer().setAddress("redis://116.62.13.104:6379");
        config.useSingleServer().setPassword("Lsh169231!");

        RedissonClient redisson = Redisson.create(config);

        return redisson;

    }
}
